export const cmsToFloat = (
  v: string | number | null,
  d: number = 0
): string | null => {
  if (v !== null) {
    const afterV =
      typeof v === "string" ? parseFloat(v).toFixed(d) : v.toFixed(d);
    return afterV;
  } else {
    return null;
  }
};
export const cmsToFloat2 = (v: any, d: number = 0): string | null => {
  return v !== null ? v.toFixed(d) : v;
};
